Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimised page file opening #837

Merged
merged 1 commit into from
May 27, 2024

Conversation

hylkevds
Copy link
Collaborator

Instead of mapping the entire page file every time a segment is re-used, we map the page file once, and re-use the mapped buffer for each segment.
The cache uses WeakReferences to ensure that a page file that is no longer used does not stay mapped.

@hylkevds
Copy link
Collaborator Author

It seems the 200ms timeout on creating subscriptions is sometimes not enough on the GitHub CI environment:

return subscribeWithIdentifier(topic, qos, subscriptionIdentifier, 200, TimeUnit.MILLISECONDS);

Do you want me to create a PR to increase it to 300?

@hylkevds hylkevds requested a review from andsel April 30, 2024 08:56
Copy link
Collaborator

@andsel andsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is good, I left a rename comment.
Plus I would ask to add a line in changelog 🙏

@hylkevds hylkevds force-pushed the fix_optimisePageFileReuse branch 2 times, most recently from 9ad8d53 to 2bd3c36 Compare May 25, 2024 18:33
Instead of mapping the entire page file every time a segment is re-used,
we map the page file once, and re-use the mapped buffer for each segment.
The cache uses WeakReferences to ensure that a page file that is no
longer used does not stay mapped.
@andsel andsel self-requested a review May 27, 2024 07:39
Copy link
Collaborator

@andsel andsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andsel andsel merged commit f222721 into moquette-io:main May 27, 2024
3 of 4 checks passed
@andsel
Copy link
Collaborator

andsel commented May 27, 2024

Thank's @hylkevds for your contribution!

@hylkevds hylkevds deleted the fix_optimisePageFileReuse branch August 25, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants